package com.mariusz.ui.models;

import java.util.List;

import javax.swing.AbstractListModel;
import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;

import com.mariusz.data.dto.Property;

public class PropertiesListModel extends AbstractListModel implements ComboBoxModel {

	private List<Property> properties;
	private Object selected;
	
	public PropertiesListModel(List<Property> list){
		super();
		properties = list;
	}
	
	@Override
	public Object getElementAt(int index) {
		
		return properties.get(index);
	}

	@Override
	public int getSize() {

		return properties.size();
	}

	@Override
	public Object getSelectedItem() {
		
		return selected;
	}

	@Override
	public void setSelectedItem(Object anItem) {
		selected = anItem;
		
	}


}
